using System.Collections.Generic;
using CfgTable;
using IQIGame.Onigao.GamePlay;
using NetProtocol.POD;

namespace IQIGame.Onigao.Logic
{
    public class LogicPetData
    {
        /** 唯一id */
        public long id;
        /** 宠物配置 */
        public CfgPet cfg;
        public int cid => cfg.Id;
        /** 创建时间--毫秒 */
        public long createTime;
        /** 宠物自定义名字 */
        public string name;

        /** 等级 */
        public int level;
        /** 当前级经验 */
        public int exp;
        /** 使用中的随机属性 */
        public List<int> usingRandAttrs;

        public LogicPetData(PetPOD pod)
        {
            this.id = pod.id;
            // this.cfg = TableCenter.pet
            this.createTime = pod.createTime;
            SyncData(pod);
        }

        public void SyncData(PetPOD pod)
        {
            this.name = pod.name;
            this.level = pod.level;
            this.exp = pod.exp;
            this.usingRandAttrs = pod.usingRandAttrs;
        }
    }
}